<%@ include file="/WEB-INF/jsp/include/skin_head.jsp" %><%@ page language="java" pageEncoding="UTF-8"%><%@ taglib uri="http://geeksaga.com/pagination-taglib" prefix="bbs" %>
    <div id="pw_bbs_list">
        <c:if test="${bbsType.categoryYn == '1'}">
        <div id="pw_category">
            <form:select path="categorySid" cssStyle="width: 120px;">
                <form:option value=""><spring:message code="category.default" /></form:option>
                <form:options items="${bbsCategory}" />
            </form:select>
        </div>
        </c:if>
        <div id="pw_bbs_list_header"></div>
        <div id="pw_bbs_list_body">
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <thead id="pw_bbs_title">
                    <tr>
                        <%--<th style="width:22px"><input type="checkbox" id="checkedSid" name="checkedSid" value="0" onclick="javascript:checkedAll();" /></th>--%>
                        <c:if test="${bbsType.categoryViewYn == '1'}">
                        <th style="width:70px"><spring:message code="bbs.category" /></th>
                        </c:if>
                        <c:if test="${bbsType.showBbsNoYn == '1'}">
                        <th style="width:40px"><spring:message code="bbs.no" /></th>
                        </c:if>
                        <c:if test="${bbsType.showThumbnailYn == '1'}">
                        <th style="width:60px"><spring:message code="bbs.thumbnail" /></th>
                        </c:if>
                        <c:if test="${bbsType.showBbsIconYn == '1'}">
                        <th style="width:20px"></th>
                        </c:if>
                        <th><spring:message code="bbs.title" /></th>
                        <c:if test="${bbsType.showNickYn == '1'}">
                        <th style="width:100px"><spring:message code="bbs.userNick" /></th>
                        </c:if>
                        <c:if test="${bbsType.showRegistDateYn == '1'}">
                        <th style="width:120px"><spring:message code="bbs.date" /></th>
                        </c:if>
                        <c:if test="${bbsType.showReadYn == '1'}">
                        <th style="width:60px"><spring:message code="bbs.viewCnt" /></th>
                        </c:if>
                    </tr>
                </thead>
                <tbody>
                    <c:if test="${total == 0}">
                    <tr>
                        <td colspan="10" align="center"><spring:message code="bbs.msg.empty"/></td>
                    </tr>
                    </c:if>
                    <c:choose>
                    <c:when test="${bbsType.listGrade <= user.grade}">
                    <c:forEach items="${list}" var="bbs" varStatus="status">
                    <tr onmouseover="this.style.backgroundColor='#f1f6fb'" onmouseout="this.style.backgroundColor='#fefefe'">
                        <%--<td><input type="checkbox" name="sid" value="${bbs.bbsNo}" /></td>--%>
                        <c:if test="${bbsType.categoryViewYn == '1'}">
                        <td>${bbsCategory[bbs.categorySid]}</td>
                        </c:if>
                        <c:if test="${bbsType.showBbsNoYn == '1'}">
                        <td>
                        <c:choose>
                        <c:when test="${bbs.noticeYn == '1'}">
                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_notice.gif"/>" class="pw_bsc" />
                        </c:when>
                        <c:otherwise>
	                        <c:choose>
	                        <c:when test="${empty param.currentPage}">
		                        <c:choose>
	                            <c:when test="${bbs.bbsNo == param.bbsNo}">
	                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_selected.gif"/>" class="pw_bsc" />
		                        </c:when>
	                            <c:otherwise>
		                        ${(total - (10 * 0)) - status.index}
	                            </c:otherwise>
	                            </c:choose>
                            </c:when>
    	                    <c:otherwise>
	                            <c:choose>
	                            <c:when test="${bbs.sid == param.sid}">
	                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_selected.gif"/>" class="pw_bsc" />
	                            </c:when>
	                            <c:otherwise>    	                    
	                            ${(total - (10 * param.currentPage)) - status.index}
	                            </c:otherwise>
	                            </c:choose>
                            </c:otherwise>
                        	</c:choose>  
                        </c:otherwise>
                        </c:choose>
                        </td>
                        </c:if>
                        <c:if test="${bbsType.showThumbnailYn == '1'}">
                        <td class="pw_thumb">
                            <img src="<c:url value="/out/thumb/no.gif"/>" width="50" height="50" style="border: 1px solid #dddddd" class="pw_bsc" />
                        </td>
                        </c:if>
                        <c:if test="${bbsType.showBbsIconYn == '1'}">
                        <td>
                        <c:choose>
                        <c:when test="${bbs.bbsIcon == 'A'}">
                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_doc.gif"/>" class="pw_bsc" />
                        </c:when>
                        <c:when test="${bbs.bbsIcon == 'B'}">
                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_file.gif"/>" class="pw_bsc" />
                        </c:when>
                        <c:when test="${bbs.bbsIcon == 'C'}">
                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_secret.gif"/>" class="pw_bsc" />
                        </c:when>
                        <c:otherwise>
                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_doc.gif"/>" class="pw_bsc" />
                        </c:otherwise>
                        </c:choose>
                        </td>
                        </c:if>
                        <td align="left">
                            <c:if test="${bbs.depth > 1}">
                            <c:forEach begin="2" end="${bbs.depth}" step="1" var="space" varStatus="status">&nbsp;</c:forEach>
                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_re.gif"/>" class="pw_bsc" />
                            </c:if>
                            <c:if test="${bbsType.tagYn == '1' and not empty bbs.tagName}">
                            <a href="<c:url value="/bbs/tag.do?tagSid=${bbs.tagSid}"/>" class="pw_gray">${bbs.tagName}</a>
                            </c:if>
                            <a href="<c:url value="/bbs/view.do?sid=${bbs.sid}&amp;currentPage=${param.currentPage}"/>">${bbs.title}</a>
                            <c:if test="${bbsType.showMemoCntYn == '1' and bbs.memoCnt > 0}">
                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_memo.gif"/>" class="pw_bsc" />
                            <span class="pw_added">${bbs.memoCnt}</span>
                            </c:if>
                            <c:if test="${bbsType.showTagCntYn == '1' and bbs.tagCnt > 0}">
                            <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_tag.gif"/>" class="pw_bsc" />
                            <span class="pw_added">${bbs.tagCnt}</span>
                            </c:if>
                            <c:choose>
                        	<c:when test="${bbsType.showBbsNewYn == '1' and not empty bbs.registDate and bbs.registTimestamp > basicDate}">
                                <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_new.gif"/>" class="pw_bsc" />
                            </c:when>
                            <c:when test="${bbsType.showBbsNewYn == '1' and not empty bbs.modifyDate and bbs.modifyTimestamp > basicDate}">
                                <img src="<c:url value="/img/skin/${bbsType.bbsSkin}/i_update.gif"/>" class="pw_bsc" />
                            </c:when>
                            </c:choose>
                        </td>
                        <c:if test="${bbsType.showNickYn == '1'}">
                        <td>${bbs.userNick}</td>
                        </c:if>
                        <c:if test="${bbsType.showRegistDateYn == '1'}">
                        <td>${bbs.modifyDate} ${bbs.modifyTime}</td>
                        </c:if>
                        <c:if test="${bbsType.showReadYn == '1'}">
                        <td>${bbs.viewCnt}</td>
                        </c:if>
                    </tr>
                    </c:forEach>
                    </c:when>
                    <c:otherwise>
                    <tr>
                        <td colspan="10" align="center"><spring:message code="bbs.msg.empty"/></td>
                    </tr>
                    </c:otherwise>
                    </c:choose>
                </tbody>
            </table>
        </div>
        <div id="pw_list_footer">
            <table border="0" width="100%" cellspacing="0" cellpadding="0">
            <colgroup>
                <col />
                <col width="3" />
                <col class="page" />
                <col width="3" />
                <col />
            </colgroup>
            <tr>
                <td class="search"><a href="<c:url value="/bbs/search.do?bbsId="/>${bbs.bbsId}&amp;command=SEARCH"><img src="<c:url value="/img/skin/${bbsType.bbsSkin}/btn_board_search.gif"/>" /></a></td>
                <td><img src="<c:url value="/img/skin/${bbsType.bbsSkin}/b_board_left.gif"/>" /></td>
                <td align="center">
                    <bbs:page
		                total="${total}"
		                pageSize="10"
		                link="${pageContext.request.contextPath}/bbs/list/${bbs.bbsId}/${bbs.categorySid}"
		                beginLabel="Home "
		                endLabel=" End"
		                prevLabel="&lt; "
		                nextLabel=" >"
		                pageGroupSize="10" />
                </td>
                <td><img src="<c:url value="/img/skin/${bbsType.bbsSkin}/b_board_right.gif"/>" /></td>
                <c:choose>
                <c:when test="${bbsType.writeGrade <= user.grade}">
                <td class="write"><a href="<c:url value="/bbs/edit.do?bbsId="/>${bbs.bbsId}&amp;command=ADD"><img src="<c:url value="/img/skin/${bbsType.bbsSkin}/btn_board_write.gif"/>" /></a></td>
                </c:when>
                <c:otherwise>
                <sec:authorize ifAnyGranted="ROLE_SUPER_USER,ROLE_MANAGER_${param.bbsId}">
                <td class="write"><a href="<c:url value="/bbs/edit.do?bbsId="/>${bbs.bbsId}&amp;command=ADD"><img src="<c:url value="/img/skin/${bbsType.bbsSkin}/btn_board_write.gif"/>" /></a></td>
                </sec:authorize>
                </c:otherwise>
                </c:choose>
            </tr>
            </table>
            <%--span class="search"><img src="<c:url value="/img/skin/default/btn_board_search.gif"/>" class="pw_pointer" /></span>
            <span><img src="<c:url value="/img/skin/default/b_board_left.gif"/>" /></span>
            <span class="page">
            </span>
            <span><img src="<c:url value="/img/skin/default/b_board_right.gif"/>" /></span>
            <sec:authorize ifAnyGranted="ROLE_SUPER_USER, ROLE_ADMIN">
            <span class="write">
                <a href="<c:url value="/bbs/edit.do?bbsId="/>${param.bbsId}"><img src="<c:url value="/img/skin/default/btn_board_write.gif"/>" class="pw_pointer" /></a>
            </span>link="list.do?categorySid=${bbs.categorySid}&amp;bbsId=${bbs.bbsId}"
            </sec:authorize--%>
        </div>
        <%@ include file="/WEB-INF/jsp/include/copyright.jsp" %>
    </div>